function Inh = smooth(In, n);
% 做光滑：
[row,col] = size(In);
ridx = 2:row-1;
lidx = 2:col-1;
Inh = In;
for i = 1:n
    Inh(ridx,lidx) = (Inh(ridx-1,lidx-1) + Inh(ridx-1,lidx+1) + ...
                      Inh(ridx+1,lidx-1) + Inh(ridx+1,lidx+1) + ...
                   2*(Inh(ridx,lidx-1) + Inh(ridx,lidx+1) + ...
                      Inh(ridx-1,lidx) + Inh(ridx+1,lidx)) + ...
                   8*Inh(ridx,lidx))/20.0;
end

%for i=2:row-1
%  for j=2:col-1
%      Inh(i,j) = (In(i-1,j-1) + In(i-1,j+1) + In(i+1,j-1) + In(i+1,j+1) + ...
%                2.0*(In(i-1,j) + In(i+1,j) + In(i,j-1) + In(i,j+1)) + ...
%                8.0*In(i,j))/20.0;
%  end
%end